#include <bits/stdc++.h>
using namespace std;

const int N = 1e5 + 5;
int n;
int r[N];

int main () {
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> r[i];
    }
    sort (r + 1, r + 1 + n);
    int s = 1, t = 2;
    for (; t <= n; ++t) {
        if (r[t] > r[s]) s++;
    }
    cout << t - s << endl;
    return 0;
}